package com.shensi.api.admin.client.market;

import com.alibaba.fastjson.JSONObject;
import com.shensi.api.admin.client.fallback.monitor.SysLogininforClientFallBack;
import com.shensi.api.admin.domian.market.dto.ReductionActivityDto;
import com.shensi.common.core.annotation.Log;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.domain.model.LoginUser;
import com.shensi.common.core.enums.BusinessType;
import com.shensi.common.core.page.TableDataInfo;
import com.shensi.common.core.utils.SecurityUtils;
import com.shensi.common.core.utils.poi.ExcelUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringJoiner;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = SysLogininforClientFallBack.class)
@Component
public interface ReductionActivityClient {

    /**
     * 查询立减活动列表
     */
    @GetMapping("/market/reductionActivity/list")
    public TableDataInfo list(@SpringQueryMap ReductionActivityDto reductionActivity);


    /**
     * 查询立减活动列表
     */
    @GetMapping("/market/reductionActivity/labelActivityList")
    public TableDataInfo labelActivityList(@SpringQueryMap ReductionActivityDto reductionActivity);

    /**
     * 导出立减活动列表
     */
    @GetMapping("/market/reductionActivity/export")
    public AjaxResult export(@SpringQueryMap ReductionActivityDto reductionActivity);

    /**
     * 获取立减活动详细信息
     */
    @GetMapping(value = "/market/reductionActivity/{activityId}")
    public AjaxResult getInfo(@PathVariable("activityId") Long activityId);

    /**
     * 新增立减活动
     */
    @PostMapping("/market/reductionActivity")
    public AjaxResult add(@RequestBody String requestJson);


    /**
     * 删除立减活动
     */
    @DeleteMapping("/market/reductionActivity/{activityIds}")
    public AjaxResult remove(@PathVariable("activityIds") Long[] activityIds);

    @GetMapping("/market/reductionActivity/changeActivityEnabled")
    public AjaxResult changeActivityEnabled(@RequestParam("activityId") Long id);
}
